/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tetris.model.blokken;

import java.awt.Color;
import java.util.Random;

/**
 *
 * @author batist
 */
class BlokFabriek {

    public static AbstractBlok maakNieuwBlok() {
        AbstractBlok blok;
        Random random = new Random();
        int type = random.nextInt(7);
        switch(type){
            case 0: //I
                blok = new BlokI();
                break;
            case 1: //J
                blok = new BlokJ();
                break;
            case 2: //L
                blok = new BlokL();
                break;
            case 3: //O
                blok = new BlokO();
                break;
            case 4: //S
                blok = new BlokS();
                break;
            case 5: //T
                blok = new BlokT();
                break;
            case 6: //Z
                blok = new BlokZ();
                break;
            default:
                blok = new BlokO();
        }
        type = random.nextInt(7);
        switch(type){
            case 0: //Green
                blok.setKleur(Color.GREEN);
                break;
            case 1: //BLUE
                blok.setKleur(Color.BLUE);
                break;
            case 2: //YELLOW
                blok.setKleur(Color.YELLOW);
                break;
            case 3: //ORANGE
                blok.setKleur(Color.ORANGE);
                break;
            case 4: //PINK
                blok.setKleur(Color.PINK);
                break;
            case 5: //CYAN
                blok.setKleur(Color.CYAN);
                break;
            case 6: //MAGENTA
                blok.setKleur(Color.MAGENTA);
                break;
            default://GRAY
                blok.setKleur(Color.GRAY);
        }
        return blok;
    }

}
